﻿namespace Creek.UI.EFML.Base.JS.ScriptingTypes
{
    using System;
    using System.Collections.Generic;

    public class Get
    {
        #region Fields

        private readonly Dictionary<string, string> inner = new Dictionary<string, string>();

        #endregion

        #region Constructors and Destructors

        public Get(string arg)
        {
            try
            {
                string[] spl = arg.Split('?', '&');
                foreach (var s in spl)
                {
                    string[] spl1 = s.Split('=');
                    this.inner.Add(spl1[0], spl1[1]);
                }
            }
            catch (Exception)
            {
            }
        }

        #endregion

        #region Public Indexers

        public string this[string k]
        {
            get
            {
                return this.inner[k];
            }
        }

        #endregion
    }
}